package com.north.light.androidutils.containrecyclerview

import android.graphics.Rect

/**
 * @Author: lzt
 * @Date: 2021/9/14 14:07
 * @Description:通用单样式线性布局decoration
 */
class LinearSingleDecoration(top: Int, bottom: Int, left: Int, right: Int) : BaseLinearVerticalDecoration() {
    var bottom: Int = 0
    var top: Int = 0
    var left: Int = 0
    var right: Int = 0

    init {
        this.bottom = bottom
        this.left = left
        this.right = right
        this.top = top
    }

    override fun startPos(): Int {
        return 0
    }

    override fun top(): Int {
        return 0
    }

    override fun bottom(): Int {
        return bottom
    }

    override fun left(): Int {
        return left
    }

    override fun right(): Int {
        return right
    }

    override fun curPos(pos: Int, rect: Rect) {
        super.curPos(pos, rect)
        if (pos == 0) {
            rect.top = top
        }
    }
}